package service.impl;

import java.util.List;

import pojo.Cargo;
import service.CargoManager;
import dao.CargoDao;
import dao.factory.DaoFactory;

public class CargoManagerImpl implements CargoManager {
	
	private CargoDao cargoDao;
	
	public CargoManagerImpl(){
		cargoDao = DaoFactory.getCargoDaoInstance();
	}
	
	public List<Cargo> getAllBooks(){
		return cargoDao.findAll();
	}
	

	@Override
	public int add(Cargo cargo) {
		return cargoDao.add(cargo);
	}

	@Override
	public int delete(String id) {
		return cargoDao.delete(id);
	}

	@Override
	public List<Cargo> getByWarehouse(String w_id) {
		return cargoDao.findByWarehousre(w_id);
	}

	@Override
	public Cargo get(String id) {
		return cargoDao.load(id);
	}

	@Override
	public int update(Cargo cargo) {
		return cargoDao.update(cargo);
	}

}
